package com.example.demo.web.filter;


import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.apache.shiro.web.servlet.AdviceFilter;

/**
 * 对拦过滤器链前置与后置进行处理
 * <p>@author Henry.Y</p>
 *
 * <p>@date 2019-08-18</p>
 */
public class MyAdviceFilter extends AdviceFilter{

	protected boolean preHandle(ServletRequest request,ServletResponse response)throws Exception{
		System.out.println("==预处理/前置处理");
		return true; //如果返回false将终端后续过滤器链的执行
	}
	
	protected void postHandle(ServletRequest request,ServletResponse response)throws Exception{
		System.out.println("==后处理/后置返回处理");
	}
	
	public void afterCompletion(ServletRequest request,ServletResponse response,Exception e)throws Exception{
		System.out.println("==完成处理/后置最终处理");
	}
}
